<script setup>
import { provide, readonly, ref } from 'vue';
import ProvideMessage from './ProvideMessage.vue';

const globalMessage = ref('全局消息')

provide('gbm',readonly(globalMessage))

const changeGlobalMessage = (newVal) => {
    globalMessage.value = newVal
}
//发布函数
provide('cgm',changeGlobalMessage)

</script>

<template>
<div>
    <ProvideMessage/>
</div>
</template>